<?php
class IndexIndexAction extends AdminAction
{
	public function __construct()
	{
		parent::__construct();
		$this->responseType = 'tpl';
		$this->layout = 'admin';
	}

	public function execute()
	{
		$position			= $this->context->get('position');
		if(!is_numeric($position))
		{
			$position		= 1;
		}
		$moduleService			= new ModuleService();
		$this->data['data'] 	= $moduleService->getListByPosition($position);
		$this->data['position']	= $position;
		
		$channelService			= new ChannelService();
		$this->data['page']		= $channelService->get($position);
		if($position==0)
		{
			$this->data['page']['name']	= '首页';
		}
		
		if($position==0)
		{
			$this->data['menu']		= 'default';
			$this->data['submenu']	= 'default_module';
		}
		else
		{
			$this->data['menu']		= 'channel';
			$this->data['submenu']	= 'channel_channel';
		}
	}
}
